<?xml version="1.0" encoding="UTF-8"?>

<project name="fc" default="db" basedir=".">
<property name="project.lib" value="../../driver" />
<property name="db.server" value="localhost" />
<property name="db.server.port" value="3306" />
<property name="db.username" value="root" />
<property name="db.password" value="" />
<property name="db.driver" value="com.mysql.jdbc.Driver" />
<property name="db.url"	value="jdbc:mysql://${db.server}:${db.server.port}" />
<target name="db" description="Crea il db">
    <echo>Url DB : ${db.url}</echo>
	<echo>Creating DB ...</echo>
	<sql driver="${db.driver}" 
	     url="${db.url}" 
	     userid="${db.username}"
		 password="${db.password}" 
		 autocommit="true" 
		 onerror="abort" 
		 encoding="UTF-8"
		 escapeprocessing="false">
		<classpath>
			<pathelement location="${project.lib}/mysql-connector-java-5.1.6-bin.jar" />
		</classpath>
		<transaction src="../table/fc_utente.sql" />
		<transaction src="../table/giocatore.sql" />
		<transaction src="../table/ruoli.sql" />
		<transaction src="../table/squadra_calciatori.sql" />
		<transaction src="../table/squadre.sql" />
		<transaction src="../table/utenti.sql" />
		<transaction src="../table/utenti_ruoli.sql" />
	</sql>
	<echo>SUCCESS!!</echo>
</target> 

</project>